home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / util / rexx / ComFromFile.lha / ComFromFile next >
Text File  |  1996-12-21  |  3KB  |  105 lines

  1. /*
  2. ** $VER: ComFromFile V1.2 (24.8.1996)
  3. **
  4. ** Comment Archives from a filelist a la FILES.BBS (Aminet CD) or
  5. ** kompartible format.
  6. **
  7. ** Examples of Columns:
  8. **
  9. ** FILES.BBS    = 34 (FileId)
  10. ** FILES.BBS    = 25 (Aminet CD)
  11. ** AMINET INDEX = 40 (Server)
  12. ** FILES.MSD    = 19 (Aminet CD)
  13. **
  14. ** Required rexxsupport.library, rexxtricks.library and Commodore list
  15. ** Command or kompartible, the librarys aviable for all Aminet Sites.
  16. **
  17. ** Write your Comment to igotu@cube.net - 2:2483/444.4@fidonet
  18. **
  19. ** Written by Reinaldo Erdey
  20. */
  21.  
  22. options results
  23.  
  24. /* --------------------------------------------------------------- */
  25. If ~Show('L','rexxtricks.library') Then
  26.     Do
  27.        If ~Addlib('rexxtricks.library',0,-30,0) Then Call Err ("Couldn't allocate rexxtricks.library!")
  28. End
  29. /* --------------------------------------------------------------- */
  30. if ~Show('L','rexxsupport.library') Then
  31.     Do
  32.        If ~Addlib('rexxsupport.library',0,-30,0) Then Call Err ("Couldn't allocate rexxsupport.library!")
  33. End
  34. /* --------------------------------------------------------------- */
  35.  
  36. SIGNAL ON HALT; SIGNAL ON BREAK_C; SIGNAL ON BREAK_D ; SIGNAL ON BREAK_F
  37.  
  38. PARSE ARG description BegCom
  39.  
  40. if strip(description) = '' | strip(description) = '?' then Do
  41.    Call Usage()
  42. End
  43.  
  44. if strip(BegCom) = '' | Datatype(BegCom) ~= 'NUM' then Do
  45.    Call Usage()
  46. End
  47.  
  48. BegCom = strip(BegCom)-1
  49.  
  50.  
  51. /* ---------------------------------------------------------------------- */
  52.  
  53. ADDRESS COMMAND
  54.  
  55. 'list >T:temp LFORMAT "%N" ~(#?.(readme|info)) FILES'
  56.  
  57. If ~Open(tmp1,'T:temp', r) Then Do
  58.     Call Err ("Couldn't open T:temp")
  59. End
  60.  
  61. do until eof(tmp1)
  62.    FileName = Strip(Readln(tmp1))
  63.    If ~Open(Tmp2,strip(description), r) Then Do
  64.        Call Err ("Couldn't open "strip(description))
  65.    End
  66.    do until eof(tmp2)
  67.       Zeile = Strip(Readln(tmp2))
  68.       PS = POS(Upper(FileName),Upper(Zeile))
  69.       If PS = 1 Then do
  70.          If Length(Right((Strip(Zeile)),(Length(strip(Zeile))-BegCom))) <= 79 then do
  71.             Call SetComment FileName,Right((Strip(Zeile)),(Length(strip(Zeile))-BegCom))
  72.             Say 'Comment File > 'FileName
  73.          End
  74.       End
  75.    End
  76.    Call Close(tmp2)
  77. End
  78. Call Close(tmp1)
  79. Call Delete 'T:temp'
  80. Exit
  81.  
  82. /* --------------------------------------------------------------- */
  83. /* Ein Error ist aufgetreten */
  84. Err:
  85.  
  86. Parse Arg String
  87. Say String
  88. Exit
  89.  
  90. /* --------------------------------------------------------------- */
  91. Usage:
  92.  
  93. Say d2c(10)||'ARexx Programm by © Reinaldo Erdey April 1996 MCMXCVI'
  94. Say '      (Comment a File from description-file)'||d2c(10)
  95. Say 'USAGE: [rx] ComFromFile Descriptionfile/A Column/A'||d2c(10)
  96. Say '      (Aminet Index = 40 - FILES.BBS = 34)'||d2c(10)
  97. Exit
  98.  
  99. /* --------------------------------------------------------------- */
  100.  
  101. BREAK_C:; BREAK_D:; BREAK_E:; BREAK_F:; HALT:
  102.  
  103. Say d2c(10)||'*** User-break detected ***'||d2c(10)
  104. Exit
  105.